package com.icinfo.cloud.provider.peripheralinterface.lawenforce.controller;

import com.icinfo.cloud.provider.peripheralinterface.lawenforce.dto.CaseBaseInfoSaveDto;
import com.icinfo.cloud.provider.peripheralinterface.lawenforce.service.ILawenforceBusinessService;
import com.icinfo.framework.common.web.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

/**
 * 描述：两法业务接口前端控制器
 *
 * @Author zhengqiang
 * @Date 2022/9/29 12:27
 **/
@RestController
@RequestMapping("/peripheralInterface/lawenforce")
@Slf4j
public class LawenforceBusinessController {

    @Resource
    private ILawenforceBusinessService lawenforceBusinessService;


    /**
     * 描述： 查询案件移送详情
     *
     * @author: zhengqiang
     * @date: 2023/1/5
     * @param: caseBaseId
     * @return {@link Result}
     **/
    @GetMapping("/getTransferCaseBaseDetail")
    public Result getTransferCaseBaseDetail(@RequestParam("caseBaseId") String caseBaseId) {
        return lawenforceBusinessService.getTransferCaseBaseDetail(caseBaseId);
    }

    /**
     * 移送案件表 新增数据
     * @author zhengqiang
     * @date 2023/1/5
     * @param caseBaseInfoDto 对象
     * @return Result<String> 保存结果
     */
    @PostMapping(value = "/saveTransferCaseInfo")
    Result<String> saveTransferCaseInfo(@RequestBody CaseBaseInfoSaveDto caseBaseInfoDto) {
        return lawenforceBusinessService.saveTransferCaseInfo(caseBaseInfoDto);
    }

    /**
     * 【V1.0.0】根据所属类别查询数据列表
     * @author zhengqiang
     * @date 2023/1/10
     * @param ownType FileOwnTypeEnum枚举类
     * @return Result
     */
    @GetMapping("/readDicListByOwnType/{ownType}")
    public Result readDicListByOwnType(@PathVariable("ownType") String ownType) {
        return lawenforceBusinessService.getDicListByOwnType(ownType);
    }

    /**
     * 【V1.0.0】通用-省市区-选择树(全国)
     *
     * @return
     * @author zhengqiang
     * @date 2023/1/10
     */
    @GetMapping("/getAllAreaTree")
    public Result getAllAreaTree() {
        return lawenforceBusinessService.getAllAreaTree();
    }

    /**
     * 删除案件附带数据
     * @author zhengqiang
     * @date 2023/1/10
     * @param messageId 数据主键id
     * @param messageType 数据类型
     * @return Result<Integer>
     */
    @DeleteMapping(value = "/delCaseCommonMessage")
    public Result<String> delCaseCommonMessage(@RequestParam("messageId") String messageId, @RequestParam("systemTag") String messageType) {
        return lawenforceBusinessService.delCaseCommonMessage(messageId, messageType);
    }

}
